#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "led.h"
#include "key.h"
#include "OLED.h"
#include "CountSensor.h"
#include "Timer.h"
#include "PWM.h"
#include "Servo.h"
#include "ADC.h"
#include "MyDMA.h"
int main()
{
	uint8_t arrA[] = {0x01, 0x02, 0x03, 0x04};
	uint8_t arrB[] = {0x00, 0x00, 0x00, 0x00};
	OLED_Init();
	MyDMA_Init(DMA1_Channel1, (uint32_t)arrA, DMA_PeripheralDataSize_Byte, DMA_PeripheralInc_Enable, (uint32_t)arrB, DMA_MemoryDataSize_Byte, 
	DMA_MemoryInc_Enable, 4, DMA_Mode_Normal, DMA_M2M_Enable, DMA_Priority_Medium);//注：地址传参时如果产生与数据类型不匹配相关的报错，可以尝试对其进行
	//强制类型转换
	while(1)
	{
		OLED_ShowHexNum(1,1,arrA[0], 2);
		OLED_ShowHexNum(1,4,arrA[1], 2);
		OLED_ShowHexNum(1,7,arrA[2], 2);
		OLED_ShowHexNum(1,10,arrA[3], 2);
		OLED_ShowHexNum(2,1,arrB[0], 2);
		OLED_ShowHexNum(2,4,arrB[1], 2);
		OLED_ShowHexNum(2,7,arrB[2], 2);
		OLED_ShowHexNum(2,10,arrB[3], 2);
		MyDMA_Transfer(DMA1_Channel1, 4, DMA1_FLAG_TC1);
		arrA[0] += 1;
		arrA[1] += 1;
		arrA[2] += 1;
		arrA[3] += 1;
		Delay_s(1);
	} 
}
